import LayoutProps,{ type ILayoutProps } from '../../basic/LayoutProps'

export interface GapProps{
  x: number,
  _x?: [{px:number,x:number}],
  y: number,
  _y?: [{px:number,y:number}],
}

export interface IGridProps extends ILayoutProps{
  defaultSpan?: number,
  align?: 'top' | 'middle' | 'bottom'
  justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between',
  wrap?: boolean,
  gaps?: GapProps
  labelWidth?: number
  labelAlign?: 'left' | 'right'
}
export default class GridProps extends LayoutProps implements IGridProps{
  public defaultSpan = 12;
  public align = 'top' as any;
  public justify = 'start' as any;
  public wrap = true;
  public gaps = {x:0,y:0};
  public labelWidth = 100;
  public labelAlign = 'left' as any;

  constructor(props?:IGridProps) {
    super({
      widgetLabel: "栅格",
      widgetType: "GRID",
      ...(props||{})
    });
    if(props){
      this.defaultSpan = props.defaultSpan || this.defaultSpan;
      this.align = props.align || this.align;
      this.justify = props.justify || this.justify;
      this.wrap = props.wrap!==undefined?props.wrap:this.wrap;
      this.gaps = props.gaps || this.gaps;
      this.labelWidth = props.labelWidth || this.labelWidth;
      this.labelAlign = props.labelAlign || this.labelAlign;
    }
  }

}

export const STATUS_OPTIONS = [
  {value:'0',label:'隐藏'},
  {value:'1',label:'占位'},
  {value:'2',label:'可见'}
]
